home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98c.txt / 000102_icon-group-sender _Mon Dec 7 14:40:25 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA29765
  4.     for icon-group-addresses; Mon, 7 Dec 1998 14:40:16 -0700 (MST)
  5. Message-Id: <199812072140.OAA29765@baskerville.CS.Arizona.EDU>
  6. Date: Mon, 07 Dec 1998 10:36:01 -0600
  7. From: MJE <evans@gte.net>
  8. To: icon-group@optima.CS.Arizona.EDU
  9. Subject: Re: Past Keyword / Coexpr Help
  10. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  11. Status: RO
  12.  
  13. I like Steve Wampler's answer.  Since "find" is a generator, presumably
  14. this function will also behave as a generator.  I would still lobby for
  15. the "past" keyword, but no complaints.
  16.  
  17. Mark
  18.  
  19.  
  20. Steve Wampler wrote:
  21. > You can write your own string analysis function to implement past().
  22. > As I understand what you want, the following would work:
  23. > procedure past(s)
  24. >    suspend (tab(find(s)),match(s))
  25. > end
  26. > I'm not convinced you really want a co-expression in your 2nd question, but
  27. > need to think about that some.  No doubt someone else will have a good
  28. > solution soon!
  29. > --
  30. > Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)]
  31. > The gods that smiled at your birth are now laughing openly. (Fortune Cookie)
  32.  
  33. Nevin Liber wrote:
  34. > > The scanning mechanism I want would perhaps be called "past", as in
  35. > >
  36. > >       numberchars := (&digits ++ 'e' ++ 'E' ++ '+' ++ '-' ++ '.')
  37. > >       string ?
  38. > >       {
  39. > >          tab(past("substring"))
  40. > >          result := real(tab(many(numberchars)))
  41. > >       }
  42. > It has find(), and it is fairly trivial to write past() using find.  Here
  43. > you go:
  44. >         procedure past(s1, s2, i1, i2)
  45. >                 suspend find(s1, s2, i1, i2) + *s1
  46. >         end
  47. > __
  48. >  Nevin ":-)" Liber  <mailto:nliber@aivia.com>  (312) 855-1000 x199
  49. > National Systems Corporation
  50. > 414 North Orleans Street, Suite 501
  51. > Chicago, IL 60610-4490
  52. > fax: (312) 222-1605
  53. > <http://www.aivia.com/>
  54.  
  55.